#include "TASK01.h"
#include "TASKLG.h"
#include "semi/InitialEvent.h"
#include "TASK01_Controller.h"

using namespace semi;
using namespace semi::conf;
using namespace semi::logg;

void task_start1() {

    Controller* tsk = new TASK01_Controller();
    tsk->doProcess("TASK01");
}

void task_start2() {

    Controller* tsk = new TASK01_Controller();
    tsk->doProcess("REC011");

}

void task_start3() {

    Controller* tsk = new TASK01_Controller();
    tsk->doProcess("INI011");
}

void task_start4() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK04");
}
void task_start5() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK05");
}
void task_start6() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK06");
}
void task_start7() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK07");
}
void task_start8() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK08");
}
void task_start9() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK09");
}
void task_start10() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK10");
}
void task_start11() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK11");
}
void task_start12() {
    Controller* tsk = new TASK01();
    tsk->doProcess("TASK12");
}

int main() {

    //    std::string str = util::StringUtil::trim("   test test     ");
    //    cout << str <<  " len:" <<str.length() << endl;

    //    InitialEvent::startup();
    //    ((Controller*) new TASKLG())->doProcess("TASKLG");

    //    task_start1();
    //    task_start2();
    //    task_start3();
    //    task_start4();
    //    task_start5();
    //    task_start6();
    //    task_start7();
    //    task_start8();
    //    task_start9();
    //    task_start10();
    //    task_start11();
    //    task_start12();

    //    TaskManager::shutdown();
    //    TaskManager::forceShutdown();

    //    semi::MessageEvent event("TASK01");
    //    event.reserveMessage(0, "intercept!");
    //    TaskManager::shutdown("TASK01");
    //    TaskManager::shutdown("REC011");

    //    InitialEvent::startup();
    //    task_start3();
    //    semi::MessageEvent event("INI011");
    //    event.reserveMessage(0, "wakeup!");
    //    TaskManager::shutdown("INI011");

    cout << posix::MessageTimer::toStringCurrentTimers() << endl;
    cout << posix::MessageQue::toStringCurrentQue() << endl;
    cout << TaskManager::toStringCurrentTasks() << endl;

    return 0;
}
